<template>
  <div ref="index">
    <el-input
      placeholder="请输入账号"
      prefix-icon="el-icon-user-solid"
      ref="inputRef"
      v-model="loginForm.loginName"
      clearable
    />
    <el-input
      clearable
      placeholder="请输入账密码"
      @keyup.native.enter="login"
      v-model="loginForm.loginPwd"
      show-password
    />
    <el-button type="primary" @click="login">登录</el-button>
  </div>
</template>


<script>
import draggable from 'vuedraggable'
import { toLoginApi, updateSetValueStateApi, getAllParamsApi, getOneParamsApi, getAllPointListApi, getEmergencyEventsListApi, getRealtimeAlarmListApi, updatePointApi } from '../../network/login_api/login_api.js'
export default {
  data () {
    return {
      loginForm: {
        loginName: 'admin',
        loginPwd: '123456'
      },
      color: ['red', 'blue', 'green']
    }
  },

  methods: {
    login () {
      let formData = new FormData()
      let { loginName, loginPwd } = this.loginForm
      formData.append('loginName', loginName)
      formData.append('loginPwd', loginPwd)
      toLoginApi(formData).then(res => {
        console.log(res)
      })
    },
  },



}
</script>

